package userManagebl;

import java.rmi.RemoteException;
import java.util.ArrayList;
import message.Message;
import VO.StudentVO;
import VO.TeacherVO;
import VO.UserVO;
import userManageblService.userManageblService;

public class UserManageController implements userManageblService{

	
	public Message register_student(String studentFileLoc) {
		UserManage um=new UserManage();
		Message message=null;
		try {
			message= um.register_student(studentFileLoc);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}

	
	public Message register_teacher(String teacherFileLoc) {
		UserManage um=new UserManage();
		Message message=null;
		try {
			message= um.register_student(teacherFileLoc);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}


	public ArrayList<String> countStudent() {
		UserManage um=new UserManage();
		ArrayList<String> countList=new ArrayList<String>();
		try {
			countList=um.countStudent();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return countList;
	}

	
	public ArrayList<String> countTeacher() {
		UserManage um=new UserManage();
		ArrayList<String> countList=new ArrayList<String>();
		try {
			countList=um.countTeacher();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return countList;
	}


	@Override
	public Message registerUserList(ArrayList<UserVO> userList) {
		UserManage um=new UserManage();
		Message message=null;
		try {
			message= um.registerUserList(userList);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}


	@Override
	public Message registerSingleUser(UserVO userVO) {
		UserManage um=new UserManage();
		Message message=null;
		try {
			message= um.registerSingleUser(userVO);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}


	@Override
	public ArrayList<UserVO> filePreview(String userFileLocation) {
		UserManage um=new UserManage();
		return um.filePreview(userFileLocation);
	}


	@Override
	public ArrayList<UserVO> showUser() {
		UserManage um=new UserManage();
		ArrayList<UserVO> userList=new ArrayList<UserVO>();
		try {
			userList=um.showUser();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return userList;
	}


	@Override
	public Message cancelAccount(UserVO userVO) {
		UserManage um=new UserManage();
		Message message=null;
		try {
			message= um.cancelAccount(userVO);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}

	
	

}
